package com.cy.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cy.dao.UserMapper;
import com.cy.entity.User;
import com.cy.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author : ChenYuan
 * @date : Created in 2020/8/12  10:20
 * @description:
 */
@Service("UserServiceImpl")
@DS("master")
public class UserServicelmpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Resource
    private UserMapper userMapper;

    // 数据源master
    @Override
    public List<User> selectUsers() {
        return userMapper.selectList(new QueryWrapper<>());
    }
}
